home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Freeware 2002 November
/
SGI Freeware 2002 November - Disc 2.iso
/
dist
/
fw_glimpse.idb
/
usr
/
freeware
/
src
/
glimpse-3.0
/
index
/
lib.c.z
/
lib.c
Wrap
C/C++ Source or Header
|
1997-09-09
|
453b
|
23 lines
/* Copyright (c) 1994 Sun Wu, Udi Manber, Burra Gopal. All Rights Reserved. */
/* ./glimpse/index/lib.c */
#include <stdio.h>
unsigned char *strdup(str)
unsigned char *str;
{
int len;
unsigned char *str1, *str1_bak;
extern char *my_malloc();
len = strlen(str);
str1 = (unsigned char *) my_malloc(len + 2);
if(str1 == NULL) {
fprintf(stderr, "malloc failure\n");
exit(2);
}
str1_bak = str1;
while(*str1++ = *str++);
return(str1_bak);
}